﻿using System.Collections.Generic;
using System.Linq;
using FoodRaidersWebAPI.domainnew.other;
using FoodRaidersWebAPI.Models;

namespace FoodRaidersWebAPI.Service.Third
{
    public class DashService
    {
        private readonly FoodContext context;

        public DashService(FoodContext context)
        {
            this.context = context;
        }
        //id查询
        public Dash findByID(int id)
        {
            return context.Dashes.FirstOrDefault(d => d.DashID == id);
        }
        //返回mid的merchant下的所有dash的id
        public List<int> findAllID(int mid)
        {
            return context.Dashes.Where(d => d.MerchantID == mid).Select(d => d.DashID).ToList();
        }
    }
}